<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Canbot Denayer 13/14 - a: denayer-canbot-13-14-a/src/lowLevel/Serial.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Canbot Denayer 13/14 - a
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="dir_53052291197db0b1569e8461e8a2ce3c.html">denayer-canbot-13-14-a</a>      </li>
      <li class="navelem"><a class="el" href="dir_bbbebf4b0795b632bf706790696c2442.html">src</a>      </li>
      <li class="navelem"><a class="el" href="dir_d149bbdd06eef14263eb86882e8ff83c.html">lowLevel</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">Serial.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="Serial_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef SERIAL_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define SERIAL_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;termios.h&gt;</span>
<a name="l00013"></a>00013 
<a name="l00014"></a>00014 <span class="keyword">using namespace </span>std;
<a name="l00015"></a>00015 
<a name="l00017"></a><a class="code" href="Serial_8h.html#aff330cb4446d20e748d2e4ac2e97c8dc">00017</a> <span class="preprocessor">#define SERIAL_DEVICE           &quot;/dev/ttyUSB0&quot;</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a><a class="code" href="Serial_8h.html#a89f82a9d44beaa52b00c7245a50a105c">00019</a> <span class="preprocessor">#define SERIAL_BAUDRATE         38400</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a><a class="code" href="Serial_8h.html#a2706d6f0b88faa4966405d2d1c792ca6">00021</a> <span class="preprocessor">#define SERIAL_DATABITS         8</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00023"></a><a class="code" href="Serial_8h.html#a088517f20a435fda1567860717da4461">00023</a> <span class="preprocessor">#define SERIAL_PARITY           0</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a><a class="code" href="Serial_8h.html#a2a7ddb3b4bdf0955971bbf88130c686d">00025</a> <span class="preprocessor">#define SERIAL_STOPBITS         1</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a><a class="code" href="Serial_8h.html#a13c5e4e536375e5530a92b4aefa4402c">00027</a> <span class="preprocessor">#define SERIAL_FLOW_CONTROL     0</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a><a class="code" href="Serial_8h.html#a6f63eb988b0b1344d3a4a00adca2429b">00029</a> <span class="preprocessor">#define SERIAL_BUF_LEN          1000</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00034"></a><a class="code" href="classSerial.html">00034</a> <span class="keyword">class </span><a class="code" href="classSerial.html" title="Sets up the serial connection and exposes it to the program.">Serial</a>{
<a name="l00035"></a>00035         <span class="keyword">public</span>:
<a name="l00039"></a>00039                 <a class="code" href="classSerial.html" title="Sets up the serial connection and exposes it to the program.">Serial</a>();
<a name="l00040"></a>00040                 
<a name="l00062"></a>00062                 <a class="code" href="classSerial.html" title="Sets up the serial connection and exposes it to the program.">Serial</a>(<span class="keywordtype">string</span> dev, <span class="keywordtype">int</span> baudrate, <span class="keywordtype">int</span> databits, <span class="keywordtype">int</span> parity,
<a name="l00063"></a>00063                         <span class="keywordtype">int</span> stopbits, <span class="keywordtype">int</span> flowControl);
<a name="l00064"></a>00064 
<a name="l00069"></a>00069                 ~<a class="code" href="classSerial.html" title="Sets up the serial connection and exposes it to the program.">Serial</a>();
<a name="l00070"></a>00070 
<a name="l00079"></a>00079                 <span class="keywordtype">int</span> swrite(<span class="keywordtype">string</span> command);
<a name="l00080"></a>00080                 
<a name="l00081"></a>00081 
<a name="l00089"></a>00089                 <span class="keywordtype">int</span> sread(<span class="keywordtype">char</span> *result);
<a name="l00090"></a>00090 
<a name="l00091"></a>00091         <span class="keyword">private</span>:
<a name="l00092"></a>00092                 <span class="keywordtype">string</span>  dev;
<a name="l00093"></a>00093                 speed_t baudrate;
<a name="l00094"></a>00094                 <span class="keywordtype">int</span>     databits,
<a name="l00095"></a>00095                         parity,
<a name="l00096"></a>00096                         stopbits,
<a name="l00097"></a>00097                         flowControl,
<a name="l00098"></a>00098                         fd;
<a name="l00099"></a>00099 
<a name="l00109"></a>00109                 <span class="keywordtype">int</span> setUp();
<a name="l00110"></a>00110 
<a name="l00111"></a>00111         <span class="keyword">protected</span>:
<a name="l00112"></a>00112                 <span class="comment">//No protected members yet</span>
<a name="l00113"></a>00113 };
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 24 2014 11:39:28 for Canbot Denayer 13/14 - a by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
